package com.fy.controller;

import com.fy.dao.ForumMapper;
import com.fy.entity.Forum;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import java.util.List;

@RestController
@RequestMapping("/forum")
public class ForumController {
    String id = "1";
    @Resource
    ForumMapper forumMapper;
    @RequestMapping("/getAll")
    public List<Forum> forumMapper(){
        return forumMapper.findAll();
    }
    @PostMapping("/insert")
    public String insert(String forum_id,String for_id){
        forumMapper.insert_forum(id,for_id);
        id=(Integer.valueOf(id)+1+"");
        return "200";
    }
}
